<?php
require_once './../script/php_class/DrawView.php';
require_once 'fb_setting.php';
require_once 'facebookAlbums.php';
require_once 'HTTP/Request2.php';
require_once ("facebook-php-sdk-master/src/facebook.php");

Facebook::$CURL_OPTS[CURLOPT_SSL_VERIFYPEER] = false;
Facebook::$CURL_OPTS[CURLOPT_SSL_VERIFYHOST] = 2;
$id = $_GET['pm'];
$setting = new Setting();
$facebook = new Facebook($setting->getLicence());
?>
<!DOCTYPE html>
<html dir="ltr" lang="ja">
	<head>
		プログラム
		データベース（バックアップ）データベース作成等で利用したSQL
		仕様書（システム概要・機能概要・DB設計・外部設計図・）
		操作説明書

		DM名:group10db
		User:group10

		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width, user-scalable=yes, maximum-scale=1.0, minimum-scale=1.0">
		<meta name="description" content="ホームページサンプル株式会社 | ホームページサンプル株式会社では最新技術と自然との調和を目指します。">
		<meta name="keywords" content="">
		<title>Albums - Solbum</title>

		<link rel="stylesheet" href="../js/css3-mediaqueries.js">
		<link rel="stylesheet" href="css/style.css" type="text/css" media="screen">
		<link rel="stylesheet" href="css/magic.css">
		<!--[if lt IE 9]>
		<script src="js/html5.js"></script>
		<script src="js/css3-mediaqueries.js"></script>
		<![endif]-->
		<script src="http://code.jquery.com/jquery-1.10.1.min.js"></script>
		<!--<script src="../js/jquery1.7.2.min.js"></script>-->
		<script src="../js/script.js"></script>
		<script src="../js/jquery.pageswitch.js"></script>
		<script src="../script/js/toast.js"></script>
		<link rel="stylesheet" href="css/magic.css">
		<script type="text/javascript" src="../script/jq/footer_fixed.js"></script>
		<script type="text/javascript">
			$(function() {
				$('.grid.img img').hover(function() {
					$(this).addClass('magictime puffIn');
				});
				$('.grid').click(function() {
					$(this).addClass('magictime vanishOut');
				});
			});
			function locate(arg) {
				location.href = "http://localhost/SocialAlbum/html/photo.php?pm=" + arg;
			}
//			$(document).ready(function() {
//				
//			}
		</script>

	</head>
	<body>
		<div id="slogan"><h1 class="inner">SNS Album Service - Solbum - </h1></div>
		<!-- Head -->
		<div id="header">
			<div class="inner">
				<!-- Logo -->
				<div class="logo">
					<a href="index.php">Solbum<br><span>Sharing Photo Engine</span></a>
				</div>
				<!-- / Logo -->
				<!-- Navigation Main -->
				<nav id="mainNav">
					<a class="menu" id="menu"><span>MENU</span></a>
					<div class="panel">
						<ul>
							<li><a href="index.php">
									<img src="../images/home.png"  width="30" height="30" alt=""><br><span>Home</span></a></li>
							<li><a href="setting.html">
									<img src="../images/setting.png" width="30" height="30" alt=""><br><span>setting</span></a></li>
						</ul>
					</div>
				</nav>
				<!-- / Navigation Main -->
			</div>
		</div>
		<!-- / Headー -->

		<div id="hr"><hr></div>

		<div id="wrapper">
			<!-- Column4 -->
			<section class="gridWrapper">
				<?php
				$facebookAlbums = new FacebookAlbums($facebook, $facebook->getAccessToken(), $facebook->getUser());
				//list取得
				$list = $facebookAlbums->getFacebookUserAlbums($id);
				if ($list !== null) {
					foreach ($list as $item) {
//					if(array_key_exists('image', $item))
						DrawView::drawBook($item['image'], $item['name'], $item['id']);
					}
				}
				?>
			</section>
			<!-- / Column4 -->

		</div>
		<!-- / WRAPPER -->

		<!-- Footerー -->
		<div id="footer">
			<div class="inner">

				<!-- Column3 -->
				<section class="gridWrapper">

					<article class="grid">
						<!-- Logo -->
						<p class="logo"><a href="index.php">Alloc<br /><span>Change Your Photo Life</span></a></p>
						<!-- / Logo -->
					</article>

					<article class="grid">
						<!-- Tell toka -->
						<p class="tel">Tell: <strong>XXX-XXX-XXXX</strong></p>
						<p>Information: AM 10:00 〜 PM 5:00</p>
						<!-- / Tell toka -->
					</article>

					<article class="grid copyright">
						Copyright(c) 2013 Alloc Inc. All Rights Reserved. Design by <a href="Alloc" target="_blank" rel="nofollow">Alloc</a>
					</article>

				</section>
				<!-- Column3 -->

			</div>
		</div>
		<!-- / Footer -->

	</body>
</html>